-
Notifications
You must be signed in to change notification settings - Fork 155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PR: Add CI workflow for package release on tag push #195
Conversation
goanpeca
commented
Oct 15, 2020
•
edited by rgbkrk
Loading
edited by rgbkrk
- Simplify release process with package publishing on CI
- Adds a check-manifest step
- Uses bump2version (the maintained fork)
4f39bc7
to
9e96c87
Compare
@MSeal, still a WIP, but this simplifies a bit the release procedure so that the artifacts can be released on CI based on a tag. I suggest we use tags that start with The process would be now: # Updates to release version and creates a commint and a tag
bump2version release --tag
# Updates to patch dev version and creates a commit
bump2version patch
# Pushes things
git push upstream master
# This will trigger a CI workflow to publish packages
git push upstream --tags (Assuming upstream poitns to this repo and not a fork, we can update this) This would make two commits from dev to relase and from release no next patch dev version. On CI packages would be published to NPM (needs to create a token) and PYPi (needs to create a token) Need to double check how tokens work with NPM publish. Thoughts? |
.bumpversion.cfg
Outdated
@@ -1,20 +1,27 @@ | |||
[bumpversion] | |||
current_version = 5.0.8.dev | |||
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(.(?P<suffix>.+))? | |||
current_version = 5.0.9.dev0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added the build part to the version, since it seems to be more standard/valid?
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(.(?P<suffix>.+))? | ||
current_version = 5.0.9.dev0 | ||
commit = True | ||
message = Bump version: {current_version} → {new_version} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can do the commit directly
.bumpversion.cfg
Outdated
commit = True | ||
message = Bump version: {current_version} → {new_version} | ||
tag = False | ||
tag_name = v{new_version} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And add the tag directly
- name: Publish NPM Package | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would need to be created on PyPI and set on the Settings
secrets
# Handle token for NPM? | ||
# https://docs.npmjs.com/using-private-packages-in-a-ci-cd-workflow | ||
run: | | ||
npm publish |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to create this token also, but I am not sure how it needs to be provided to the npm publish command (maybe create the npmrc file as the link above?)
@MSeal let me know what you think :). |
Hi Sorry @goanpeca I'm going to be fairly unresponsive for a bit as I had a new addition to the family over the weekend. I like moving to github actions where possible and I'm not opposed to automating releases, though I've not automated any of the jupyter repos for PyPI / npm release so far since it's sometimes good to have a human take the steps explicitly. In this case I'd check with @rgbkrk, @minrk, or @takluyver in case on of them is free / has an opinion. |
Congratulations! and sure, no problem. I have been automating this way a lot of other projects and I think it makes maintenance much easier and shareable among other team members. This optimizes for having more maintainers, which is something we struggle to find in open source. |
I'm a fan of automating this. The credentials piece is usually the trickiest bit, since it needs to be encrypted in the repo but accessible by automation. What's the plan for that? |
Github secrets basically. |
@goanpeca Hi! Do you want to finish this up and then we can cut a release with all the open PRs? |
9e96c87
to
6ba0be3
Compare
Should we remove python 3.5 support? |
I think this one is ready @willingc. Before we can test this, we need to add 2 Repository secrets to the Settings of this repo.
To create the pypi one, one needs to go to https://pypi.org/manage/account/token/ and create a token for the specific package. I would suggest using a bot account (jupyter-bot) to automate this process and avoid having CI workflows attached to personal accounts. To create the NPM one, one needs to go to https://www.npmjs.com/settings//tokens and create a new These values should be added as the secrest rspectively. I am not currently a maintainer of this project but I would be happy to help with it and set things up, and help moving things forward :) |
@goanpeca Check your inbox. I've bumped your privileges so that you can enable the secrets needed. |
Awesome @willingc. Now I (only) need access to https://pypi.org/project/nbformat/ Anyone in there should be able to bump me :) And on https://www.npmjs.com/package/nbformat I think @rgbkrk has access to both, you could add me, if you agree of course. Cheers! |
It looks like Jupyterlab has an nbformat package that could/should be automated to receive these updates too, unless the purpose of the package is different: https://www.npmjs.com/package/@jupyterlab/nbformat |
Hi @rgbkrk, thanks.
|
@goanpeca -- all set for npm and PyPI. I think you have to accept the invite (somehow?) |
@rgbkrk received! Thanks :) |
Let me know when this is ready to merge, otherwise feel free to go forward with it @goanpeca. |
Thanks, will look into this later today :) |
fac6936
to
a71334b
Compare
a71334b
to
a00402a
Compare